package com.example.produces.service.impl;

import com.example.produces.entity.Owarehouse;
import com.example.produces.mapper.OwarehouseMapper;
import com.example.produces.service.OwarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class OwarehouseImpl implements OwarehouseService {
    @Autowired
    private OwarehouseMapper owarehouseMapper;
    @Override
    public List<Owarehouse> findAll() {
        List<Owarehouse>owarehouses=owarehouseMapper.findAll();
        return owarehouses;
    }

    @Override
    public void add(Owarehouse owarehouse) {
            owarehouseMapper.add(owarehouse);
    }

    @Override
    public Owarehouse findOne(String designation) {
        return owarehouseMapper.findOne(designation);
    }

    @Override
    public void upDate(Owarehouse owarehouse) {
     owarehouseMapper.upDate(owarehouse);
    }

    @Override
    public void delete(String designation) {
      owarehouseMapper.delete(designation);
    }
}
